function exportView(i)
{
	Canvas2Image.saveAsPNG($(View.views[i].id).find('canvas')[0]);
	
	jQuery(document).trigger('close.facebox');
	
	return false;
}

$(function ()
{
	var viewList = '';

	jQuery.each(
		View.views, function (i)
		{
			viewList +=
				'<span onclick="return exportView(' + i + ')" '
				+ 'class="clickable">' + i + '</span>';
		});
	
	
	$('#viewList').append(viewList);
});
